package com.chianghao.rock.system.dao.role_scope;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.chianghao.core.mybatis.sql.SqlWrapper;
import com.chianghao.core.mybatis.sql.db_enum.SqlOperators;
import com.chianghao.rock.system.entity.RoleScope;

@Component
public class RoleScopeDao {


	@Autowired
	RoleScopeMapper mapper;
	
	public List<RoleScope> queryByRoleIds(List<Long> rouleIds, int type) {
		SqlWrapper sqlWrapper =  new SqlWrapper()
				.addCondition(RoleScope::getRoleId, SqlOperators.in,rouleIds.toArray(new Long[rouleIds.size()]))
				.addCondition(RoleScope::getScopeType,type);
		return this.mapper.queryList(sqlWrapper);
	}

}